source /root/admin-openstack.sh

#创建tenant项目和tenant用户以及user角色
openstack project create --domain default --description "{{ KEYSTONE_TENANT_PROJECT }} project" {{ KEYSTONE_TENANT_PROJECT }}
openstack user create --domain default --password {{ KEYSTONE_TENANT_PASS }} {{ KEYSTONE_TENANT_USER }}
openstack role create user
openstack role add --project {{ KEYSTONE_TENANT_PROJECT }} --user {{ KEYSTONE_TENANT_USER }} user

#创建Service项目
openstack project create --domain default --description "Service Project" service

#创建glance用户
openstack user create --domain default --password {{ GLANCE_KEYSTONE_PASS }} {{ GLANCE_KEYSTONE_USER }}
openstack role add --project service --user {{ GLANCE_KEYSTONE_USER }} admin


#创建nova用户
openstack user create --domain default --password {{ NOVA_KEYSTONE_PASS }} {{ NOVA_KEYSTONE_USER }}
openstack role add --project service --user {{ NOVA_KEYSTONE_USER }} admin


#创建placement用户
openstack user create --domain default --password {{ PLACEMENT_KEYSTONE_PASS }} {{ PLACEMENT_KEYSTONE_USER }}
openstack role add --project service --user {{ PLACEMENT_KEYSTONE_USER }} admin


#创建Neutron用户
openstack user create --domain default --password {{ NEUTRON_KEYSTONE_PASS }} {{ NEUTRON_KEYSTONE_USER }}
openstack role add --project service --user {{ NEUTRON_KEYSTONE_USER }} admin


#创建cinder用户
openstack user create --domain default --password {{ CINDER_KEYSTONE_PASS }} {{ CINDER_KEYSTONE_USER }}
openstack role add --project service --user {{ CINDER_KEYSTONE_USER }} admin
